<ui:composition template="/WEB-INF/templates/defaultLayout.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core">
	<ui:define name="title">
		#{lang.getTrans("ui.mobile.user.title")} 
	</ui:define>

	<ui:define name="layoutCenter">
		<h:form>
			<p:growl id="growl" showDetail="true" />
			<p:breadCrumb>
				<p:menuitem value="#{lang.getTrans('ui.mobile.common.bread.home')}" url="/home.xhtml"/>
				<p:menuitem value="#{lang.getTrans('ui.mobile.common.bread.user')}" url="/crud/user/userList.xhtml"/>
			</p:breadCrumb>
			<p:dataTable id="basic" var="user" value="#{usersBean.users}"
				paginator="true" rows="15"
				paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}">
				
				<p:column id="idServiceButton" style="width:14px; text-align:center;" sortBy="#{user.idUser}">
					<f:facet name="header">	
						<p:commandButton style="width:18px;height:18px;" title="#{lang.getTrans('ui.mobile.common.new')}" 
						icon="ui-icon-circle-plus" action="#{usersBean.toForm}"/>				
					</f:facet>
					<p:commandButton style="width:18px;height:18px;" title="#{lang.getTrans('ui.mobile.common.delete')}" 
						icon="ui-icon-trash" action="#{usersBean.remover}" update="@form">  
   						<f:setPropertyActionListener target="#{usersBean.user}" value="#{user}" />
					</p:commandButton>  
				</p:column>
				
				<p:column style="width:14px;">
					<p:commandButton style="width:18px;height:18px;" title="#{lang.getTrans('ui.mobile.common.edit')}" 
						icon="ui-icon-circle-triangle-e" action="#{usersBean.toForm}">  
   						<f:setPropertyActionListener target="#{usersBean.user}" value="#{user}" />  
					</p:commandButton>  							
				</p:column>

				<p:column id="cdUser">
					<f:facet name="header">#{lang.getTrans("ui.mobile.user.name")}</f:facet>
					<h:outputText value="#{user.cdUser}" />
				</p:column>
				<p:column id="dsEmail">
					<f:facet name="header">#{lang.getTrans("ui.mobile.user.email")}</f:facet>
					<h:outputText value="#{user.cdEmail}" />
				</p:column>
				<p:column id="cdPhone">
					<f:facet name="header">#{lang.getTrans("ui.mobile.user.phone")}</f:facet>
					<h:outputText value="#{user.cdPhone}" />
				</p:column>
				<p:column id="dsLogin">
					<f:facet name="header">#{lang.getTrans("ui.mobile.user.login")}</f:facet>
					<h:outputText value="#{user.cdLogin}" />
				</p:column>
			</p:dataTable>
		</h:form>
	</ui:define>
</ui:composition>
